Replace calls to g_memdup() with g_memdup2()
authorSimon McVittie <smcv@collabora.com>
Fri, 28 Oct 2022 11:19:29 +0000 (12:19 +0100)
committerColin Walters <walters@verbum.org>
Fri, 11 Nov 2022 22:10:37 +0000 (17:10 -0500)
commit29340dba04d2af4a6c3e067ace43ce670e717d62
tree792098c85d2d4e06c795760397daaf5ee57b22a4
parentbef337e1bd8451783bbc1ace34e6a08cd978d32b
Replace calls to g_memdup() with g_memdup2()

g_memdup() is subject to an integer overflow on 64-bit machines if the
object being copied is larger than UINT_MAX bytes. I suspect none of
these objects can actually be that large in practice, but it's easier
to replace all the calls than it is to assess whether we need to
replace them.

A backport in libglnx is used on systems where GLib is older than 2.68.x.

Signed-off-by: Simon McVittie <smcv@collabora.com>
src/libostree/ostree-repo-commit.c
src/libostree/ostree-sign-ed25519.c
src/libotutil/ot-checksum-utils.c
src/libotutil/ot-variant-utils.c
tests/test-commit-sign-sh-ext.c